home *** CD-ROM | disk | FTP | other *** search
- global gCreateListDialog, glPFListNames, gNewList
-
- on setupCreateListDialog
- gNewList = new(xtra("MUI"))
- if objectp(gNewList) then
- CreateListDialogWinPropList = GetWindowPropList(gNewList)
- CreateListDialogWinPropList.name = "Name The New List:"
- CreateListDialogWinPropList.callback = "CreateListDialogCallBack"
- CreateListDialogWinPropList.mode = #pixel
- CreateListDialogWinPropList.closeBox = 1
- CreateListDialogWinPropList.modal = 1
- CreateListDialogWinPropList.xPosition = -1
- CreateListDialogWinPropList.yPosition = -1
- CreateListDialogWinPropList.width = 180
- CreateListDialogWinPropList.height = 80
- myWindowItemList = []
- tempItemProps = GetItemPropList(gNewList)
- tempItemProps.type = #WindowBegin
- append(myWindowItemList, duplicate(tempItemProps))
- tempItemProps = GetItemPropList(gNewList)
- tempItemProps.type = #editText
- tempItemProps.value = EMPTY
- tempItemProps.locH = 8
- tempItemProps.locV = 10
- tempItemProps.width = 150
- tempItemProps.height = 60
- setProp(tempItemProps, #attributes, [#textStyle: [#plain]])
- append(myWindowItemList, duplicate(tempItemProps))
- tempItemProps = GetItemPropList(gNewList)
- tempItemProps.type = #defaultPushButton
- tempItemProps.title = "OK"
- tempItemProps.locH = 8
- tempItemProps.locV = 40
- tempItemProps.width = 70
- tempItemProps.height = 20
- append(myWindowItemList, duplicate(tempItemProps))
- tempItemProps = GetItemPropList(gNewList)
- tempItemProps.type = #pushButton
- tempItemProps.title = "Cancel"
- tempItemProps.locH = 100
- tempItemProps.locV = 40
- tempItemProps.width = 70
- tempItemProps.height = 20
- append(myWindowItemList, duplicate(tempItemProps))
- tempItemProps = GetItemPropList(gNewList)
- tempItemProps.type = #WindowEnd
- append(myWindowItemList, duplicate(tempItemProps))
- Initialize(gNewList, [#windowPropList: CreateListDialogWinPropList, #windowItemList: myWindowItemList])
- else
- end if
- end
-
- on CreateListDialogCallBack event, eventData, itemPropList
- if symbolp(event) then
- case event of
- #itemChanged:
- editedText = itemPropList.value
- glPFListNames = [editedText]
- #itemClicked:
- if itemPropList.title = "Cancel" then
- glPFListNames = []
- stopCreateListDialog()
- end if
- if itemPropList.title = "OK" then
- stopCreateListDialog()
- end if
- #windowOpening:
- #windowClosed:
- #windowZoomed:
- #windowResized:
- #itemEnteringFocus:
- #itemLosingFocus:
- end case
- end if
- end
-
- on runCreateListDialog
- global gNewList
- if objectp(gNewList) then
- Run(gNewList)
- end if
- end
-
- on stopCreateListDialog
- global gNewList
- if objectp(gNewList) then
- stop(gNewList, 0)
- end if
- go(the frame)
- end
-